import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/introduce'
    },
    {
      path: '/introduce',
      name: 'introduce',
      component: () => import(/* webpackChunkName: "introduce" */ '../views/Introduce.vue')
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      component: () => import(/* webpackChunkName: "dashboard" */ '../views/Index.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import(/* webpackChunkName: "login" */ '../views/Login.vue')
    },
    {
      path: '/add',
      name: 'add',
      component: () => import(/* webpackChunkName: "add" */ '../views/AddGood.vue')
    },
    {
      path: '/stock',
      name: 'stock',
      component: () => import(/* webpackChunkName: "swiper" */ '../views/stock.vue')
    },
    {
      path: '/audit',
      name: 'audit',
      component: () => import(/* webpackChunkName: "hot" */ '../views/audit.vue')
    },
    {
      path: '/new',
      name: 'new',
      component: () => import(/* webpackChunkName: "new" */ '../views/new.vue')
    },
    {
      path: '/purchase',
      name: 'purchase',
      component: () => import(/* webpackChunkName: "recommend" */ '../views/purchase.vue')
    },
/*    {
      path: '/category',
      name: 'category',
      component: () => import(/!* webpackChunkName: "category" *!/ '../views/Category.vue'),
      children: [
        {
          path: '/category/level2',
          name: 'level2',
          component: () => import(/!* webpackChunkName: "level2" *!/ '../views/Category.vue'),
        },
        {
          path: '/category/level3',
          name: 'level3',
          component: () => import(/!* webpackChunkName: "level3" *!/ '../views/Category.vue'),
        }
      ]
    },*/
    {
      path: '/good',
      name: 'good',
      component: () => import(/* webpackChunkName: "new" */ '../views/Good.vue')
    },
    {
      path: '/guest',
      name: 'guest',
      component: () => import(/* webpackChunkName: "guest" */ '../views/Guest.vue')
    },
    {
      path: '/order',
      name: 'order',
      component: () => import(/* webpackChunkName: "order" */ '../views/Order.vue')
    },
    {
      path: '/discount',
      name: 'discount',
      component: () => import(/* webpackChunkName: "order_detail" */ '../views/discount.vue')
    },
    {
      path: '/ReturnOrder',
      name: 'ReturnOrder',
      component: () => import(/* webpackChunkName: "account" */ '../views/ReturnOrder.vue')
    },
    {
      path: '/supplierReturn',
      name: 'supplierReturn',
      component: () => import(/* webpackChunkName: "account" */ '../views/supplierReturn.vue')
    },
  ]
})

export default router